<template>
  <div class="list">
    <div class="list-item" v-for="item in listData" :key="item.id">
      <div class="img">
        <img :src="item.url" alt="" />
      </div>
      <div class="info">
        <p class="title">{{item.title}}</p>
        <p class="desc">{{item.desc}}</p>
        <p class="price">￥{{item.price}}</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: {
    listData: {
      type: Array,
      defalut: [],
    },
  },
  mounted() {
    console.log(this.listData);
    // this.$bus.$on('shoucang',data=>{
    //     console.log(data);
    //     this.itemData = data
    //     console.log(this.itemData);
    // })
  },
};
</script>

<style lang="less" scoped>
// 产品
.list {
  width: 100%;
  .list-item {
    height: 111px;
    border: 1px solid #eee;
    padding: 11.5px 11px;
    box-sizing: border-box;
    display: flex;
    .img {
      width: 126px;
      height: 85px;
      margin-right: 11px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .info {
      width: 200px;
      // flex: 1;
      .title {
        width: 196px;
        height: 23px;
        line-height: 20px;
        color: rgba(16, 16, 16, 1);
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin: 8px 0 5px;
      }
      .desc {
        // width: 200px;
        height: 34px;
        line-height: 17px;
        color: rgba(153, 153, 153, 1);
        font-size: 12px;
        display: -webkit-box;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
      }
    }
  }
}
.price {
  width: 34px;
  height: 23px;
  line-height: 13px;
  color: rgba(255, 68, 68, 1);
  font-size: 14px;
  text-align: center;
  //   margin-top: 5px;
}
</style>